Embodiments of the invention relate to a software build tool. More specifically, embodiments of the invention relate to techniques and mechanisms to manage building of applications including redirecting calls to selected files.
Computer systems generally run software programs which carry out the desired functionality of users of the computer systems. The programs which run on the computer system are generally executable program files. An executable program file is generally a binary representation of machine instructions specific to the processor the program is intended to run on. An executable program file may also be a binary representation of the machine instructions for a virtual machine. It is very difficult for programmers to understand the binary representation of machine instructions. Even if the binary representation were to be translated to the machine instructions themselves, it would still be hard for programmers to read and understand the machine instructions. With modern computing, computer programs are now written by programmers in high-level, human readable instructions. These high level instructions are often referred to as “source code.” Examples of such high-level languages include C, C++, and JAVA.
Unfortunately, source code is often not directly executable by the computer system. The high-level source code is often translated into “object files” by a compiler. The compiler reads the high-level source code and creates object files which contain a machine code version of the source code. A program called a linker creates an executable file by taking the object files and linking them to the appropriate libraries, modules or routines need by the program. The executable file is now capable of being run on the computer system.
As user requirements have become more complex and varied, programs have also become more complex and varied. While a program may be created using only a single source code file, it is often easier to organize the code into separate source code files. These separate source code modules may each contain parts of the complete source code for the program and may often be organized such that they are logical representations of the overall structure of the program. Because of the separation of the complete source code into modules, some modules may use or “depend” on other modules. For example, a first module may require the functions, variables or objects defined in a second module, so in order to compile the first module, one would first have to compile the second module first. Such a relationship between the first module and the second module is called a “dependency.” These dependencies often complicate the compilation process as changes in one module may result in many other modules having to be recompiled.
In order to solve problems resulting from dependencies, a “make” utility is used to control the compiler. The make utility keeps track of the dependencies and controls the compiler to recompile not only source code modules that were modified, but also other modules which depend on the changed modules. The make utility is run every time changes are made to any module so that all dependent programs or modules are properly recompiled. A make utility requires that the source code programmer also compose a specialized control file, known as a “makefile”, which contains instructions or commands that the make function uses to control the compilation and linking of each of the source code modules when the make function is executed. The makefile typically includes a hierarchy of source modules that embody the dependencies found in the program. For example, a makefile may include a variety of elements such as a series of instructions containing “targets”, dependencies, and “shell commands” for updating the targets.